<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>props 函数式组件</title>
</head>
<body>
    <div id="root"> </div>

    <script src="../js/react.development.js"></script>
    <script src="../js/react-dom.development.js"></script>
    <script src="../js/babel.min.js"></script>

    <script type="text/babel">
        let data = {
            name:'楠楠',
            age: 18,
            gender: '女'
        }

        let data2 = {
            name:'罗兰',
            age: 18,
            gender: '女'
        }

        function Student(props){
            return <ul>
                    <li>姓名: {props.name}</li>
                    <li>年龄: {props.age}</li>
                    <li>性别: {props.gender}</li>
                </ul>
        }

        ReactDOM.render(
            <div>
                <Student name={data.name} age={data.age} gender={data.gender} />
                <Student {...data2} />
            </div>, 
            document.querySelector("#root"));
    </script>
</body>
</html>